import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/about/index.vue')
    },
    {
      path: '/exercise',
      name: 'exercise',
      component: () => import('../views/exercise/index.vue')
    },
    {
      path: '/demo',
      name: 'demo',
      component: () => import('../views/demo/index.vue')
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   component: () => import('../views/about/index.vue')
    // },
    {
      path: '/document',
      name: 'document',
      component: () => import('../views/document/index.vue')
    },
    {
      path: '/activity',
      name: 'activity',
      component: () => import('../views/activity/index.vue')
    },
    {
      path: '/:catchAll(.*)',
      redirect: { name: 'home' }
    },
  ],
  scrollBehavior () {
    return { top: 0 };
  },
})

export default router
